import org.springframework.beans.BeanUtils;

/**
 * Created by zhihao.guo on 2018/1/15.
 */
public class BeanCopyDemo {
    public static void main(String[] args) {
        User user = new User();
        user.setAge(11);
        UserDTO userDTO = new UserDTO();
        userDTO.age = 10;
        userDTO.name = "heheda";
        BeanUtils.copyProperties(user, userDTO);
        System.out.println("userDTO.age = " + userDTO.age);
        System.out.println("userDTO.name = " + userDTO.name);

    }
}
